# pragma once

#include <Eigen/Dense>
#include <ceres/ceres.h>

#include "Optimizer.h"

namespace Estimator
{

class Optimizer;

class StateUpdateCallback : public ceres::IterationCallback
{
  public:
    explicit StateUpdateCallback(Optimizer* pOptimizer, std::string folderName, bool log_to_stdout = true) : 
                        mpOptimizer_(pOptimizer), mFolderName_(folderName), log_to_stdout_(log_to_stdout)
                        {}

    virtual ~StateUpdateCallback() = default;

    virtual ceres::CallbackReturnType operator()(const ceres::IterationSummary &summary) override;

  private:
    Optimizer* mpOptimizer_;
    std::string mFolderName_;
    const bool log_to_stdout_;
};
}